package com.zj.HJ;

import java.util.Scanner;

public class HJ33 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String num = sc.nextLine();
        System.out.println(getRes(num));
    }

    public static String getRes(String ip) {
        String[] arr = ip.split("\\.");
        int[] unit = {256 * 256 * 256, 256 * 256, 256};
        if (arr.length == 1) {
            long ipnum = Long.parseLong(ip);
            StringBuilder sb = new StringBuilder();
            int i = 0;
            while (i < 3) {
                long res = ipnum / unit[i];
                ipnum = ipnum % unit[i];
                sb.append(res).append(".");
                i++;
            }
            sb.append(ipnum);
            return sb.toString();

        } else {
            long sum = Long.parseLong(arr[arr.length - 1]);
            for (int i = arr.length - 2; i >= 0; i--) {
                sum += Long.parseLong(arr[i]) * unit[i];
            }
            return String.valueOf(sum);
        }
    }
}
